},
}
-function AutorunResidentSource() {
- this._init();
-}
-
-AutorunResidentSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const AutorunResidentSource = new Lang.Class({
+ Name: 'AutorunResidentSource',
+ Extends: MessageTray.Source,
_init: function() {
- MessageTray.Source.prototype._init.call(this, _("Removable Devices"));
+ this.parent(_("Removable Devices"));
this._mounts = [];
icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE });
}
-}
+});
-function AutorunResidentNotification(source) {
- this._init(source);
-}
-
-AutorunResidentNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const AutorunResidentNotification = new Lang.Class({
+ Name: 'AutorunResidentNotification',
+ Extends: MessageTray.Notification,
_init: function(source) {
- MessageTray.Notification.prototype._init.call(this, source,
- source.title, null,
- { customContent: true });
+ this.parent(source, source.title, null, { customContent: true });
// set the notification as resident
this.setResident(true);
return item;
},
-}
+});
function AutorunTransientDispatcher() {
this._init();
}
}
-function AutorunTransientSource(mount, apps) {
- this._init(mount, apps);
-}
-
-AutorunTransientSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const AutorunTransientSource = new Lang.Class({
+ Name: 'AutorunTransientSource',
+ Extends: MessageTray.Source,
_init: function(mount, apps) {
- MessageTray.Source.prototype._init.call(this, mount.get_name());
+ this.parent(mount.get_name());
this.mount = mount;
this.apps = apps;
return new St.Icon({ gicon: this.mount.get_icon(),
icon_size: this.ICON_SIZE });
}
-}
+});
-function AutorunTransientNotification(source) {
- this._init(source);
-}
-
-AutorunTransientNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const AutorunTransientNotification = new Lang.Class({
+ Name: 'AutorunTransientNotification',
+ Extends: MessageTray.Notification,
_init: function(source) {
- MessageTray.Notification.prototype._init.call(this, source,
- source.title, null,
- { customContent: true });
+ this.parent(source, source.title, null, { customContent: true });
this._box = new St.BoxLayout({ style_class: 'hotplug-transient-box',
vertical: true });
return button;
}
-}
+});
};
DBus.conformExport(Keyboard.prototype, CaribouKeyboardIface);
-function KeyboardSource() {
- this._init.apply(this, arguments);
-}
-
-KeyboardSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const KeyboardSource = new Lang.Class({
+ Name: 'KeyboardSource',
+ Extends: MessageTray.Source,
_init: function(keyboard) {
+ this.parent(_("Keyboard"));
this._keyboard = keyboard;
- MessageTray.Source.prototype._init.call(this, _("Keyboard"));
this._setSummaryIcon(this.createNotificationIcon());
},
icon_size: this.ICON_SIZE });
},
- handleSummaryClick: function() {
+ handleSummaryClick: function() {
let event = Clutter.get_current_event();
if (event.type() != Clutter.EventType.BUTTON_RELEASE)
return false;
open: function() {
this._keyboard.show();
}
-};
+});
// the content and the action area of the notification will be cleared.
// The content area is also always cleared if 'customContent' is false
// because it might contain the @banner that didn't fit in the banner mode.
-function Notification(source, title, banner, params) {
- this._init(source, title, banner, params);
-}
+const Notification = new Lang.Class({
+ Name: 'Notification',
-Notification.prototype = {
IMAGE_SIZE: 125,
_init: function(source, title, banner, params) {
this.actor.destroy();
this.actor._delegate = null;
}
-};
+});
Signals.addSignalMethods(Notification.prototype);
-function Source(title) {
- this._init(title);
-}
+const Source = new Lang.Class({
+ Name: 'MessageTraySource',
-Source.prototype = {
ICON_SIZE: 24,
_init: function(title) {
_lastNotificationRemoved: function() {
this.destroy();
}
-};
+});
Signals.addSignalMethods(Source.prototype);
function SummaryItem(source) {
}
};
-function SystemNotificationSource() {
- this._init();
-}
-
-SystemNotificationSource.prototype = {
- __proto__: Source.prototype,
+const SystemNotificationSource = new Lang.Class({
+ Name: 'SystemNotificationSource',
+ Extends: Source,
_init: function() {
- Source.prototype._init.call(this, _("System Information"));
+ this.parent(_("System Information"));
this._setSummaryIcon(this.createNotificationIcon());
},
open: function() {
this.destroy();
}
-};
+});
}
};
-function Source(title, pid, sender) {
- this._init(title, pid, sender);
-}
-
-Source.prototype = {
- __proto__: MessageTray.Source.prototype,
+const Source = new Lang.Class({
+ Name: 'NotificationDaemonSource',
+ Extends: MessageTray.Source,
_init: function(title, pid, sender) {
- MessageTray.Source.prototype._init.call(this, title);
+ this.parent(title);
this._pid = pid;
if (sender)
this._nameWatcherId = 0;
}
- MessageTray.Source.prototype.destroy.call(this);
+ this.parent();
}
-};
+});
}
Signals.addSignalMethods(ShellMountQuestionDialog.prototype);
-function ShellMountPasswordSource(message, icon, reaskPassword) {
- this._init(message, icon, reaskPassword);
-}
-
-ShellMountPasswordSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const ShellMountPasswordSource = new Lang.Class({
+ Name: 'ShellMountPasswordSource',
+ Extends: MessageTray.Source,
_init: function(message, icon, reaskPassword) {
let strings = message.split('\n');
- MessageTray.Source.prototype._init.call(this, strings[0]);
+ this.parent(strings[0]);
this._notification = new ShellMountPasswordNotification(this, strings, icon, reaskPassword);
Main.messageTray.add(this);
this.notify(this._notification);
},
-}
+});
Signals.addSignalMethods(ShellMountPasswordSource.prototype);
-function ShellMountPasswordNotification(source, strings, icon, reaskPassword) {
- this._init(source, strings, icon, reaskPassword);
-}
-
-ShellMountPasswordNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const ShellMountPasswordNotification = new Lang.Class({
+ Name: 'ShellMountPasswordNotification',
+ Extends: MessageTray.Notification,
_init: function(source, strings, icon, reaskPassword) {
- MessageTray.Notification.prototype._init.call(this, source,
- strings[0], null,
- { customContent: true,
- icon: icon });
+ this.parent(source, strings[0], null, { customContent: true, icon: icon });
// set the notification to transient and urgent, so that it
// expands out
this.source.emit('password-ready', text);
}
-}
+});
function ShellProcessesDialog(icon) {
this._init(icon);
}
});
-function Source() {
- this._init.apply(this, arguments);
-}
-
-Source.prototype = {
- __proto__: MessageTray.Source.prototype,
+const Source = new Lang.Class({
+ Name: 'BluetoothSource',
+ Extends: MessageTray.Source,
_init: function() {
- MessageTray.Source.prototype._init.call(this, _("Bluetooth"));
+ this.parent(_("Bluetooth"));
this._setSummaryIcon(this.createNotificationIcon());
},
icon_type: St.IconType.SYMBOLIC,
icon_size: this.ICON_SIZE });
}
-}
-
-function AuthNotification() {
- this._init.apply(this, arguments);
-}
+});
-AuthNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const AuthNotification = new Lang.Class({
+ Name: 'AuthNotification',
+ Extends: MessageTray.Notification,
_init: function(source, applet, device_path, name, long_name, uuid) {
- MessageTray.Notification.prototype._init.call(this,
- source,
- _("Bluetooth"),
- _("Authorization request from %s").format(name),
- { customContent: true });
+ this.parent(source,
+ _("Bluetooth"),
+ _("Authorization request from %s").format(name),
+ { customContent: true });
this.setResident(true);
this._applet = applet;
this.destroy();
}));
}
-}
-
-function ConfirmNotification() {
- this._init.apply(this, arguments);
-}
+});
-ConfirmNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const ConfirmNotification = new Lang.Class({
+ Name: 'ConfirmNotification',
+ Extends: MessageTray.Notification,
_init: function(source, applet, device_path, name, long_name, pin) {
- MessageTray.Notification.prototype._init.call(this,
- source,
- _("Bluetooth"),
- _("Pairing confirmation for %s").format(name),
- { customContent: true });
+ this.parent(source,
+ _("Bluetooth"),
+ _("Pairing confirmation for %s").format(name),
+ { customContent: true });
this.setResident(true);
this._applet = applet;
this.destroy();
}));
}
-}
-
-function PinNotification() {
- this._init.apply(this, arguments);
-}
+});
-PinNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const PinNotification = new Lang.Class({
+ Name: 'PinNotification',
+ Extends: MessageTray.Notification,
_init: function(source, applet, device_path, name, long_name, numeric) {
- MessageTray.Notification.prototype._init.call(this,
- source,
- _("Bluetooth"),
- _("Pairing request for %s").format(name),
- { customContent: true });
+ this.parent(source,
+ _("Bluetooth"),
+ _("Pairing request for %s").format(name),
+ { customContent: true });
this.setResident(true);
this._applet = applet;
MessageTray.Notification.prototype.grabFocus.call(this, lockTray);
global.stage.set_key_focus(this._entry);
}
-}
+});
}
});
-function NMMessageTraySource() {
- this._init();
-}
-
-NMMessageTraySource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const NMMessageTraySource = new Lang.Class({
+ Name: 'NMMessageTraySource',
+ Extends: MessageTray.Source,
_init: function() {
- MessageTray.Source.prototype._init.call(this, _("Network Manager"));
+ this.parent(_("Network Manager"));
let icon = new St.Icon({ icon_name: 'network-transmit-receive',
icon_type: St.IconType.SYMBOLIC,
});
this._setSummaryIcon(icon);
}
-};
+});
}
};
-function ChatSource(account, conn, channel, contact, client) {
- this._init(account, conn, channel, contact, client);
-}
-
-ChatSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const ChatSource = new Lang.Class({
+ Name: 'ChatSource',
+ Extends: MessageTray.Source,
_init: function(account, conn, channel, contact, client) {
- MessageTray.Source.prototype._init.call(this, contact.get_alias());
+ this.parent(contact.get_alias());
this.isChat = true;
this._shouldAck = false;
}
-};
+});
-function ChatNotification(source) {
- this._init(source);
-}
-
-ChatNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const ChatNotification = new Lang.Class({
+ Name: 'ChatNotification',
+ Extends: MessageTray.Notification,
_init: function(source) {
- MessageTray.Notification.prototype._init.call(this, source, source.title, null, { customContent: true });
+ this.parent(source, source.title, null, { customContent: true });
this.setResident(true);
this._responseEntry = new St.Entry({ style_class: 'chat-response',
this.source.setChatState(Tp.ChannelChatState.ACTIVE);
}
}
-};
-
-function ApproverSource(dispatchOp, text, gicon) {
- this._init(dispatchOp, text, gicon);
-}
+});
-ApproverSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const ApproverSource = new Lang.Class({
+ Name: 'ApproverSource',
+ Extends: MessageTray.Source,
_init: function(dispatchOp, text, gicon) {
- MessageTray.Source.prototype._init.call(this, text);
+ this.parent(text);
this._gicon = gicon;
this._setSummaryIcon(this.createNotificationIcon());
icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE });
}
-}
-
-function RoomInviteNotification(source, dispatchOp, channel, inviter) {
- this._init(source, dispatchOp, channel, inviter);
-}
+});
-RoomInviteNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const RoomInviteNotification = new Lang.Class({
+ Name: 'RoomInviteNotification',
+ Extends: MessageTray.Notification,
_init: function(source, dispatchOp, channel, inviter) {
- MessageTray.Notification.prototype._init.call(this,
- source,
- /* translators: argument is a room name like
- * room@jabber.org for example. */
- _("Invitation to %s").format(channel.get_identifier()),
- null,
- { customContent: true });
+ this.parent(source,
+ /* translators: argument is a room name like
+ * room@jabber.org for example. */
+ _("Invitation to %s").format(channel.get_identifier()),
+ null,
+ { customContent: true });
this.setResident(true);
/* translators: first argument is the name of a contact and the second
this.destroy();
}));
}
-};
+});
// Audio Video
-function AudioVideoNotification(source, dispatchOp, channel, contact, isVideo) {
- this._init(source, dispatchOp, channel, contact, isVideo);
-}
-
-AudioVideoNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const AudioVideoNotification = new Lang.Class({
+ Name: 'AudioVideoNotification',
+ Extends: MessageTray.Notification,
_init: function(source, dispatchOp, channel, contact, isVideo) {
let title = '';
/* translators: argument is a contact name like Alice for example. */
title = _("Call from %s").format(contact.get_alias());
- MessageTray.Notification.prototype._init.call(this,
- source,
- title,
- null,
- { customContent: true });
+ this.parent(this, source, title, null, { customContent: true });
this.setResident(true);
this.addButton('reject', _("Reject"));
this.destroy();
}));
}
-};
+});
// File Transfer
-function FileTransferNotification(source, dispatchOp, channel, contact) {
- this._init(source, dispatchOp, channel, contact);
-}
-
-FileTransferNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const FileTransferNotification = new Lang.Class({
+ Name: 'FileTransferNotification',
+ Extends: MessageTray.Notification,
_init: function(source, dispatchOp, channel, contact) {
- MessageTray.Notification.prototype._init.call(this,
- source,
- /* To translators: The first parameter is
- * the contact's alias and the second one is the
- * file name. The string will be something
- * like: "Alice is sending you test.ogg"
- */
- _("%s is sending you %s").format(contact.get_alias(),
- channel.get_filename()),
- null,
- { customContent: true });
+ this.parent(this,
+ source,
+ /* To translators: The first parameter is
+ * the contact's alias and the second one is the
+ * file name. The string will be something
+ * like: "Alice is sending you test.ogg"
+ */
+ _("%s is sending you %s").format(contact.get_alias(),
+ channel.get_filename()),
+ null,
+ { customContent: true });
this.setResident(true);
this.addButton('decline', _("Decline"));
this.destroy();
}));
}
-};
+});
// A notification source that can embed multiple notifications
-function MultiNotificationSource(title, icon) {
- this._init(title, icon);
-}
-
-MultiNotificationSource.prototype = {
- __proto__: MessageTray.Source.prototype,
+const MultiNotificationSource = new Lang.Class({
+ Name: 'MultiNotificationSource',
+ Extends: MessageTray.Source,
_init: function(title, icon) {
- MessageTray.Source.prototype._init.call(this, title);
+ this.parent(title);
this._icon = icon;
this._setSummaryIcon(this.createNotificationIcon());
},
notify: function(notification) {
- MessageTray.Source.prototype.notify.call(this, notification);
+ this.parent(notification);
this._nbNotifications += 1;
icon_type: St.IconType.FULLCOLOR,
icon_size: this.ICON_SIZE });
}
-};
+});
// Subscription request
-function SubscriptionRequestNotification(source, contact) {
- this._init(source, contact);
-}
-
-SubscriptionRequestNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const SubscriptionRequestNotification = new Lang.Class({
+ Name: 'SubscriptionRequestNotification',
+ Extends: MessageTray.Notification,
_init: function(source, contact) {
- MessageTray.Notification.prototype._init.call(this, source,
- /* To translators: The parameter is the contact's alias */
- _("%s would like permission to see when you are online").format(contact.get_alias()),
- null, { customContent: true });
+ this.parent(this, source,
+ /* To translators: The parameter is the contact's alias */
+ _("%s would like permission to see when you are online").format(contact.get_alias()),
+ null, { customContent: true });
this._contact = contact;
this._connection = contact.get_connection();
this._invalidatedId = 0;
}
- MessageTray.Notification.prototype.destroy.call(this);
+ this.parent();
},
_subscriptionStatesChangedCb: function(contact, subscribe, publish, msg) {
if (publish != Tp.SubscriptionState.ASK)
this.destroy();
}
-};
-
-
-function AccountNotification(source, account, connectionError) {
- this._init(source, account, connectionError);
-}
+});
// Messages from empathy/libempathy/empathy-utils.c
// create_errors_to_message_hash()
_connectionErrorMessages[Tp.error_get_dbus_name(Tp.Error.CERT_LIMIT_EXCEEDED)]
= _("The length of the server certificate, or the depth of the server certificate chain, exceed the limits imposed by the cryptography library");
-AccountNotification.prototype = {
- __proto__: MessageTray.Notification.prototype,
+const AccountNotification = new Lang.Class({
+ Name: 'AccountNotification',
+ Extends: MessageTray.Notification,
_init: function(source, account, connectionError) {
- MessageTray.Notification.prototype._init.call(this, source,
- /* translators: argument is the account name, like
- * name@jabber.org for example. */
- _("Connection to %s failed").format(account.get_display_name()),
- null, { customContent: true });
+ this.parent(source,
+ /* translators: argument is the account name, like
+ * name@jabber.org for example. */
+ _("Connection to %s failed").format(account.get_display_name()),
+ null, { customContent: true });
this._label = new St.Label();
this.addActor(this._label);
this._connectionStatusId = 0;
}
- MessageTray.Notification.prototype.destroy.call(this);
+ this.parent();
}
-};
+});
}
};
-function Source(app, window) {
- this._init(app, window);
-}
-
-Source.prototype = {
- __proto__ : MessageTray.Source.prototype,
+const Source = new Lang.Class({
+ Name: 'WindowAttentionSource',
+ Extends: MessageTray.Source,
_init: function(app, window) {
- MessageTray.Source.prototype._init.call(this, app.get_name());
+ this.parent(app.get_name());
this._window = window;
this._app = app;
this._setSummaryIcon(this.createNotificationIcon());
Main.activateWindow(this._window);
this.destroy();
}
-};
+});